﻿
//using System;
//using System.Collections.Generic;
//using System.Linq;
//using System.Text;
//using System.Windows.Forms;
//using System.IO.Ports;
//using RemoteScriptingLibrary.ScriptCommands;

//public class ScriptCompilerClass
//{
//    public void Test()
//    {
//        //Zieht eine Cartridge schrittweise über die Haltenoppe im Slot und liest Analogwerte des Kraftsensors
////über den Stecker des Roation Home Sensors aus und trägt sie in eine Tabelle ein.
////kann mehrere Slots nacheinander bearbeiten
////Holt die Zuordnung Slot zu Kasettenname aus der Datei "Ausziehkraft Slotsettings.dms"
////------------------------------------------------------------------------------------------
////VARIABLENDEKLARATION

//var iline = 0;
//var error ="Hallo";
//var step = 1.0f;
//var scancounter = 0;
//var loopcounter = 0;
//var distance = 0;
//var unitheight = 0;
//var verticalval = 0;
//var valcounter = 0;
//var charcounter = 0;

//var reihe = 0;
//var vielfach = 0;
//var spalte = 0;
//var magazin = 0;
//var seite = 0;
//var y_offsetcom = 0;
//var x_offsetcom = 0;
//var sledsteps = 0;
//var cartridge = 0;
//var schritte = 0;
//var ruckweg = 0;
//var traccounter = 0;
//var bearbnummer = 0;
//var ziehcounter = 0;
//var slotcounter = 0;
//var valid = 0;
//var eingabfalsch = 0;
//var slotmax = 0;

//var sernum = 0;
//var strdummy = "";
//var STR_INPUT = "";
//var datei = 0;
//var horizontalline = 0;
//var verticalline = 0;
//var offsetline = 0;
//var platz = 0;
//var slotstring = 0;

//var elevpos = new int[13];
//var sledpos = new int[13];
//var elevcorrval = new int[13];

//var slot = new int[97];
//var cartridgename = new int[97];

//var sensvolt = new int[121];
//var kraft = new int[121];

//Script.Serial("rob 4 0");;

////;#Retry=1					;Login in Library controller
////#IgnoreCmdPrompt=1
////#Sleep=300
//Script.Serial("Lgi");
//Script.Serial("secret");
//Script.Serial("abcxyz007");
////#IgnoreCmdPrompt=0
////#nop
////#Sleep=0
////----------------------------------------------------------------
// // gripper   open
//Script.Serial("gro");
//// slider    home
//Script.Serial("shm") ;
//// elevator  home
//Script.Serial("eh")  ;
//// sled move
//Script.Serial("slm") ;

////----------------------------------------------------------------
////Abfrage der Geräte-Höhe
//Script.Serial("dbi LIBHEIGHT")							;

////#set(%iLine,2)
////#getline(%iLine , 1, 5,%strdummy)
////#if(%strdummy == "Field")
////	#add(%iLine, %iLine, 1)
////#endif
////#if(%strdummy == "Comma")
////	#sub(%iLine, %iLine, 1)
////#endif
////#getline(%iLine , 1,  255,%strdummy)
////#midstr(%strdummy,31,1)
//unitheight = Convert.ToInt32(strdummy);
////
////#if(%unitheight == 8)
//slotmax = 95;
////#endif
////
////#if(%unitheight == 4)
//slotmax = 47;
////#endif
////
////#msg="Gerätehöhe"
////#msg=%unitheight


////-----------------------------------------------------------------
////Slotpositionen =  horizontal
//sledpos[1] = 3307;			
//sledpos[2] = 2211;
//sledpos[3] = 1116;
//sledpos[4] = 20;

////#if(%unitheight  =  =  8
//elevpos[1] = 0;
//elevpos[2] = 439;
//elevpos[3] = 878;
//elevpos[4] = 1563;
//elevpos[5] = 2002;
//elevpos[6] = 2441;
//elevpos[7] = 3126;
//elevpos[8] = 3565;
//elevpos[9] = 4004;
//elevpos[10] = 4689;
//elevpos[11] = 5128;
//elevpos[12]  = 5567;
////#endif

////#if(%unitheight   =    =   4
//elevpos[1] = 0;
//elevpos[2] = 439;
//elevpos[3] = 878;
//elevpos[4] = 1600;
//elevpos[5] = 2040;
//elevpos[6] = 2480;
////#endif

//Script.;---------------------------------------------------------------;

////Koordinatentabelle auslesen
//Script.Serial("gmpos");

////#wait=2000

//iLine = 12;
////#getline(%iLine , 1, 5,%strdummy)
////#if(%strdummy == " Mag0"
////	#inc(%iLine,1)
////#endif
////#if(%strdummy == "Indiv"
////	#dec(%iLine,1)
////#endif
////#getline(%iLine , 1,  255,%strdummy)
//offsetline = strdummy;
//iLine = 6;
////#getline(%iLine , 1,  255,%strdummy)
//horizontalline = strdummy;
//iLine = 9;
////#getline(%iLine , 1,  255,%strdummy)
//verticalline = strdummy;

////#if(%unitheight == 8)
//Script.	%loopcounter = 7;;
//Script.	//#else;
//Script.		%loopcounter = 3;;
////#endif
////Zeile der Korrekturwerte auswerten
//strdummy = offsetline;	
////#midstr(%strdummy,1,5)
//corrval = strdummy;


//elevcorrval[1] = corrval;
//valcounter = 2;
//charcounter = 6;

////#loop = %loopcounter
//Script.	%strdummy = offsetline;;
////	#midstr(%strdummy,%charcounter,6)
////;	#msg=%strdummy
//Script.	%elevcorrval[valcounter] = strdummy;;
////	#inc(%charcounter,6)
////	#inc(%valcounter,1)
////#endloop


////Zeile der Horizontalwerte auswerten
//strdummy = %horizontalline;
////#midstr(%strdummy,1,5)
//horizontalval = strdummy;


//sledpos[1] = horizontalval
//valcounter = 2
//charcounter = 6

////#loop=3
//Script.	%strdummy = %horizontalline;;
////	#midstr(%strdummy,%charcounter,6)
////;	#msg=%strdummy
//Script.	%sledpos[valcounter] = strdummy;;
////	#inc(%charcounter,6)
////	#inc(%valcounter,1)
////#endloop

////#if(%unitheight == 8)
//Script.	%loopcounter = 11;;
////	#else
//Script.		%loopcounter = 5;
////#endif
////Zeile der Vertikalwerte auswerten
//strdummy = verticalline;	
////#midstr(%strdummy,1,5)
//verticalval = strdummy;


//elevpos[1] = verticalval;
//valcounter = 2;
//charcounter = 6;

////#loop = %loopcounter
//Script.	%strdummy = verticalline;;
////	#midstr(%strdummy,%charcounter,6)
////;	#msg=%strdummy
//Script.	%elevpos[valcounter] = strdummy;;
////	#inc(%charcounter,6)
////	#inc(%valcounter,1)
////#endloop

////;#msg="Horizontal"
////;#msg=%sledpos[1]
////;#msg=%sledpos[2]
////;#msg=%sledpos[3]
////;#msg=%sledpos[4]

////;#msg="Vertikal"
////;#msg=%elevpos[1]
////;#msg=%elevpos[2]
////;#msg=%elevpos[3]
////;#msg=%elevpos[4]
////;#msg=%elevpos[5]
////;#msg=%elevpos[6]

////;#msg="Offset"
////;#msg=%elevcorrval[1]
////;#msg=%elevcorrval[2]
////;#msg=%elevcorrval[3]
////;#msg=%elevcorrval[4]


////#Msgbox = "Ausgelesen"
////---------------------------------------------------

////Abfrage der Serien-Nummer
//Script.Serial("dbi LDRSERNUM");

//iLine = 2;
////#getline(%iLine , 1, 5,%strdummy)
////#if(%strdummy == "Field")
////	#add(%iLine, %iLine, 1)
////#endif
////#if(%strdummy == "Comma")
////	#sub(%iLine, %iLine, 1)
////#endif
////#getline(%iLine , 1,  255,%strdummy)
////#midstr(%strdummy,31,11)
//sernum = strdummy;

////#msg="Seriennummer"
////#msg=%sernum
////	#msgBox= "  Seriennummer"

//    }
//}